package com.yang.project.base.set.set;

import org.junit.Test;

import java.lang.reflect.Array;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class SetTest {
    /**
     * set是有序还是无序的
     * 无序、不可重复
     */
    @Test
    public void test() {
        Set<String> set = new HashSet<>();
        set.add("张飒");
        set.add("王五");
        set.add("李四");
        Iterator<String> iterator = set.iterator();
        while (iterator.hasNext()) {
            String next = iterator.next();
            System.out.println(next);
        }
    }
}
